//
//  HttpTool.m
//  UseBlock
//
//  Created by liy on 2024/12/19.
//

#import "HttpTool.h"

@interface HttpTool ()
@property (nonatomic, copy) void (^ callback) (NSString *name);
@end

@implementation HttpTool
- (void)loadData:(void (^)(NSString *_Nonnull))callback {
	self.callback = callback;
  
  dispatch_async(dispatch_get_global_queue(0, 0), ^{
    NSLog(@"发送网络请求：%@", [NSThread currentThread]);

    dispatch_async(dispatch_get_main_queue(), ^{
      NSLog(@"拿到数据并回调： %@", [NSThread currentThread]);
      callback(@"json数据");
    });
  });
}

@end
